Compatibilty with plain TEX

The file german.tex [4] was written in such a way that it can be used by both plain TEX users and LATEX users. This seemed a good idea, so all files in the babel system can be processed by both plain TEX and LATEX. But some of the ``useful hacks'' from LATEX are used, so for a plain TEX user they have to be defined. For this purpose the format is checked at the start of a language specific file. If the format is plain an extra file, called latexhax.tex is read.
Figure: Conditonal loading of latexhax.sty
\begin{figure*}\begin{verbatim}{\def\format{plain}
\ifx\fmtname\format
\expan...
...ax.sty}
\aftergroup\input\aftergroup\next
\fi
\fi}\end{verbatim}
\end{figure*}

This file should be read only once, so another check is done on the existence of one of the commands defined there.

A new group is started to keep the definition of the macro \format, which is used in the following if statement, local. When the current format turns out to be plain TEX the file latexhax.sty has to be read. But the definitions in that file should remain valid after the group is closed. This could be accomplished by making all definitions global, but another solution is to tell TEX to process the file latexhax.sty after the current group has been closed. The command \aftergroup puts the next token on a list to be processed after the group.